 /**异步器 */
export type CollPromiseObj<T> = {
    promiseObj: Promise<T>
    resolve: (value: T) => void | undefined
    reject: (value: string) => void | undefined
    execTime: number
  }
 /**
* 异步控制器
* @returns 控制对象
*/
export const createPromiseObj: <T>() => CollPromiseObj<T> = <T>() => {
 let resolve: ((value: T) => void) | undefined
 let reject: ((reason: any) => void) | undefined
 const uploadPromiseObj = {
   promiseObj: new Promise((res: ((value: T) => void) | undefined, rej) => {
     resolve = res
     reject = rej
   }),
   resolve: (value: T) => {},
   reject: (value: any) => {},
   execTime: +new Date(),
 }
 uploadPromiseObj.resolve = resolve!
 uploadPromiseObj.reject = reject!
 return uploadPromiseObj
}
